package com.gudaichaoren.spider.global;


import com.gudaichaoren.spider.entity.User;

import java.io.Serializable;

/**
 * @author gu.chao
 */
public class ThreadLocalUtil implements Serializable {

    private static final long serialVersionUID = -7930018761171005136L;

    private static final ThreadLocal<User> sessionThreadLocal = new ThreadLocal<User> ();

    public static void setSessionThreadLocal(User user) {
        sessionThreadLocal.set (user);
    }

    public static User getSessionThreadLocal() {
        return sessionThreadLocal.get ();
    }

    public static void removeSessionThreadLocal() {
        sessionThreadLocal.remove ();
    }
}
